package com.hup.utils.io.batch.function;

import com.hup.utils.io.batch.BaseBatch;

import java.util.ArrayList;

/**
 * @author hugan
 * @date 2020/4/2
 */
public class TaskList implements BaseBatch<Boolean> {

    private String exeName;

    public TaskList(String exeName) {
        this.exeName = exeName;
    }

    @Override
    public String cmd() {
        return "tasklist /fi \"IMAGENAME eq " + exeName + "\"";
    }

    @Override
    public String desc() {
        return "查询[" + exeName + "]是否正在运行";
    }

    @Override
    public Boolean parse(ArrayList<String> lstResp) {
        boolean none = lstResp.get(0).contains("没有");
        return !none;
    }
}
